package org.nekperu15739.me.persistencejpa.dao.implementations.h2;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nekperu15739.me.persistencejpa.dao.abstracts.i18n.LanguajeDaoAbstract;
import org.nekperu15739.me.persistencejpa.dao.interfaces.i18n.LanguageDao;
import org.nekperu15739.me.persistencejpa.entities.implementation.i18n.LanguageEntityJpa;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

//@Repository
@Service
public class LanguajeDaoH2 extends LanguajeDaoAbstract {

    private final Log logger = LogFactory.getLog(getClass());
    
    @Autowired
    private LanguageDao languageDao;

    @Override
    @PersistenceContext(unitName = "persistenceUnitI18n")
    protected void setEntityManager(EntityManager entityManager) {
        super.setEntityManager(entityManager);
        getLogger().info("inyectado entityManager");
    }

    private Log getLogger() {
        return logger;
    }

	@Override
	public List<LanguageEntityJpa> findAll() {
		List<LanguageEntityJpa> findAll = languageDao.findAll();
		getLogger().info(findAll);
		return findAll;
	}

	@Override
	public List<LanguageEntityJpa> findAll(Sort sort) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<LanguageEntityJpa> findAll(Iterable<Integer> ids) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public <S extends LanguageEntityJpa> List<S> save(Iterable<S> entities) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public LanguageEntityJpa saveAndFlush(LanguageEntityJpa entity) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void deleteInBatch(Iterable<LanguageEntityJpa> entities) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void deleteAllInBatch() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public LanguageEntityJpa getOne(Integer id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Page<LanguageEntityJpa> findAll(Pageable pageable) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public <S extends LanguageEntityJpa> S save(S entity) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public LanguageEntityJpa findOne(Integer id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean exists(Integer id) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public long count() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void delete(Integer id) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void delete(Iterable<? extends LanguageEntityJpa> entities) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void deleteAll() {
		// TODO Auto-generated method stub
		
	}

}